{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Formula Database Tutorial\n", " \n", " outline:\n", " 1. How to better write your formulas in the database.\n", " 2. Comming soon!\n", " " ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import pandas as pd\n", "import sympy as sp\n", "\n", "import FormulaLab as fl" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 1. How to write your formulas in the database\n", "\n", "**FormulaLab has specific assumptions when reading formulas, such as:**\n", " \n", " 1. Case sensitivity. (A does not equal a)\n", " 2. Follows python syntax, such as, power (**) not (^)\n", " 3. Follow SymPy syntax, such as, sin, cos, integrate, diff, ...\n", " 4. All different variables must have different names in one database, \n", " to avoid mixing physics!\n", " 5. Constants should ends with \"_\" (eg., speed_of_light_, plank_, gravity_).\n", " Because constants does not help with derivation and slow the searching \n", " speed.\n", " 6. (Optional) It is recomended to use capital letters with Vector quantities \n", " and small letters with scalar quantities(eg., Force, mass). \n", " (FormulaLab will tell the difference in future versions)\n", " \n", "**Suggestions:**\n", "\n", " 1- Write a full and uniqe name of all of the variables in your formula \n", " database.\n", " 2- Add as many column in your database as you can, so you can use them \n", " later as filters. \n", " Because formulas can be mixed with unrelated field of study, which leads \n", " to wrong answers.\n", " 3- Add underscore \"_\" at the end of constants." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | ID | \n", "Formula | \n", "Field | \n", "Reference | \n", "Note | \n", "
---|---|---|---|---|---|
0 | \n", "1 | \n", "Displacement = Velocity * time | \n", "Mechanics | \n", "NaN | \n", "NaN | \n", "
1 | \n", "2 | \n", "Acceleration = Velocity / time | \n", "Mechanics | \n", "NaN | \n", "NaN | \n", "
2 | \n", "3 | \n", "Force = mass * Acceleration | \n", "Mechanics | \n", "NaN | \n", "NaN | \n", "
3 | \n", "4 | \n", "Weight = mass * Gravety | \n", "Mechanics | \n", "NaN | \n", "NaN | \n", "
4 | \n", "5 | \n", "Momentum = mass * Velocity | \n", "Mechanics | \n", "NaN | \n", "NaN | \n", "
5 | \n", "6 | \n", "Centerpetal_acceleration = Velocity**2 / radious | \n", "Mechanics | \n", "NaN | \n", "NaN | \n", "
6 | \n", "7 | \n", "work = Force * Displacement | \n", "Mechanics | \n", "NaN | \n", "NaN | \n", "
7 | \n", "8 | \n", "Kinetic_energy = mass * Velocity**2 / 2 | \n", "Mechanics | \n", "NaN | \n", "NaN | \n", "
8 | \n", "9 | \n", "Power = work / time | \n", "Mechanics | \n", "NaN | \n", "NaN | \n", "
9 | \n", "10 | \n", "pressure = Force / Area | \n", "Mechanics | \n", "NaN | \n", "NaN | \n", "
10 | \n", "11 | \n", "frequency = c_ / wavelength | \n", "Waves | \n", "NaN | \n", "NaN | \n", "
11 | \n", "12 | \n", "time_perioud = 1 / frequency | \n", "Waves | \n", "NaN | \n", "NaN | \n", "
12 | \n", "13 | \n", "refractive_index = c_ / Velocity | \n", "Waves | \n", "NaN | \n", "NaN | \n", "
13 | \n", "14 | \n", "Electric_field = Force / charge | \n", "EM | \n", "NaN | \n", "NaN | \n", "
14 | \n", "15 | \n", "Electric_potential = Electric_field * Displace... | \n", "EM | \n", "NaN | \n", "NaN | \n", "